package org.semanticflash.rdf.utils
{
	
	import flexunit.framework.TestCase;
	
	
	/**
	 * @private
	 * 
	 * @author aldo.bucchi@gmail.com
	 * 
	 */	
	public class RDFUtilTest extends TestCase
	{
		
		
  		public function testSplitNSAndLocal():void
  		{
		

			var samples:Array = [
				 "http://www.ribbit.com/"
				,"http://www.ribbit.com"


				,"http://xmlns.com/foaf/0.1/"
				,"http://xmlns.com/foaf/0.1/ Person"
				
				,"http://www.w3.org/People/Berners-Lee/ card"
				,"http://www.w3.org/People/Berners-Lee/card#"
				,"http://www.w3.org/People/Berners-Lee/card# i"
				
				,"mailto:me@office.org"
				,"http://example.org/aleyton# me"
				,"http://example.org/aleyton: me"
				,"http://example.org/aleyton/ me"
				,"urn://example.org"
				
		
				// not sure what the following test should yield ( aldo.bucchi@gmail.com )
				//   urn://example.org/test:wrong
				
				
			];

			for each ( var sample:String in samples )
			{
				nsl( sample );
			}
			

   		}
   		
   		
  		
   		private function nsl( str:String ):void
   		{
   			var result:String = RDFUtil.splitNSAndLocal( str.split(" ").join( "" ) ).join( " " );
			if ( result != str )
				fail( "expected <"+str+"> but got <"+result+">" );
   		}
   		
   		
   		
		
	}
	
}